package com.OrderingSystem.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "product_category")
public class ProductCategory {

    @ApiModelProperty(value = "类别ID", required = true, example = "1")
    @TableId(value = "category_id", type = IdType.AUTO)  // 设置主键自增
    private Integer categoryId;

    @ApiModelProperty(value = "类别名称", required = true, example = "风味小吃")
    @TableField(value = "category_name")
    private String categoryName;

    @ApiModelProperty(value = "类别类型", required = true, example = "1")
    @TableField(value = "category_type")
    private Integer categoryType;

    @ApiModelProperty(value = "创建时间", example = "2020-05-01 12:00:00")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间", example = "2020-05-01 12:00:00")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
}
